<template>
  <div data-v-37dfd6fc="" id="app">
    <header data-v-37dfd6fc="" class="login-header">
      <div data-v-37dfd6fc="" class="commonwidth">
        <h1 data-v-37dfd6fc="" class="logo">
          <a data-v-37dfd6fc="" href="#/">小兔鲜</a>
        </h1>
        <h3 data-v-37dfd6fc="" class="sub">欢迎登录</h3>
        <a data-v-37dfd6fc="" href="#/" class="entry">
          进入网站首页
          <i data-v-37dfd6fc="" class="iconfont icon-angle-right"></i
          ><i data-v-37dfd6fc="" class="iconfont icon-angle-right"></i
        ></a>
      </div>
    </header>
    <section data-v-37dfd6fc="" class="login-section">
      <div data-v-37dfd6fc="" class="wrapper">
        <nav data-v-37dfd6fc="">
          <a data-v-37dfd6fc="" href="javascript:;">账户登录</a
          ><a data-v-37dfd6fc="" href="javascript:;">扫码登录</a>
        </nav>
        <div data-v-37dfd6fc="" class="account-box">
          <div data-v-37dfd6fc="" class="toggle">
            <a data-v-37dfd6fc="" href="javascript:;"
              ><i data-v-37dfd6fc="" class="iconfont icon-envelope-o"></i>
              使用短信登录
            </a>
          </div>
          <form
            data-v-37dfd6fc=""
            novalidate="novalidate"
            autocomplete="off"
            class="form"
          >
            <div data-v-37dfd6fc="" class="form-item">
              <div data-v-37dfd6fc="" class="input">
                <i data-v-37dfd6fc="" class="iconfont icon-user-o"></i
                ><input
                  data-v-37dfd6fc=""
                  type="text"
                  placeholder="请输入用户名"
                  name="account"
                  v-model="account"
                />
              </div>
            </div>
            <div data-v-37dfd6fc="" class="form-item">
              <div data-v-37dfd6fc="" class="input">
                <i data-v-37dfd6fc="" class="iconfont icon-lock8"></i
                ><input
                  data-v-37dfd6fc=""
                  type="password"
                  placeholder="请输入密码"
                  name="password"
                  v-model="password"
                />
              </div>
            </div>
            <div data-v-37dfd6fc="" class="form-item">
              <div data-v-37dfd6fc="" class="agree">
                <span data-v-37dfd6fc="">我已同意</span
                ><a data-v-37dfd6fc="" href="javascript:;">《隐私条款》</a
                ><span data-v-37dfd6fc="">和</span
                ><a data-v-37dfd6fc="" href="javascript:;">《服务条款》</a>
              </div>
            </div>
            <a data-v-37dfd6fc="" href="javascript:;" class="btn" @click="clk()"
              >登录</a
            >
          </form>
          <div data-v-37dfd6fc="" class="action">
            <a
              data-v-37dfd6fc=""
              href="https://graph.qq.com/oauth2.0/authorize?client_id=101941968&amp;response_type=token&amp;scope=all&amp;redirect_uri=http%3A%2F%2Ferabbit.itheima.net%2F%23%2Flogin%2Fcallback"
              ><img
                data-v-37dfd6fc=""
                src="https://qzonestyle.gtimg.cn/qzone/vas/opensns/res/img/Connect_logo_7.png"
                alt=""
            /></a>
            <div data-v-37dfd6fc="" class="url">
              <a data-v-37dfd6fc="" href="javascript:;">忘记密码</a
              ><a data-v-37dfd6fc="" href="javascript:;">免费注册</a>
            </div>
          </div>
        </div>
      </div>
    </section>
    <footer data-v-37dfd6fc="" class="login-footer">
      <div data-v-37dfd6fc="" class="commonwidth">
        <p data-v-37dfd6fc="">
          <a data-v-37dfd6fc="" href="javascript:;">关于我们</a
          ><a data-v-37dfd6fc="" href="javascript:;">帮助中心</a
          ><a data-v-37dfd6fc="" href="javascript:;">售后服务</a
          ><a data-v-37dfd6fc="" href="javascript:;">配送与验收</a
          ><a data-v-37dfd6fc="" href="javascript:;">商务合作</a
          ><a data-v-37dfd6fc="" href="javascript:;">搜索推荐</a
          ><a data-v-37dfd6fc="" href="javascript:;">友情链接</a>
        </p>
        <p data-v-37dfd6fc="">CopyRight © 小兔鲜儿</p>
      </div>
    </footer>
  </div>
</template>
<script>
export default {
  data() {
    return {
      account: "",
      password: "",
    };
  },
  methods: {
    clk() {
      this.axios
        .post("https://apipc-xiaotuxian-front.itheima.net/login", {
          account: this.account,
          password: this.password,
        })
        .then((res) => {
          console.log(res);
          if (res.data.msg == "操作成功") {
            this.$store.commit("login", res.data.result);
            this.$router.push("/");
          }
        });
    },
  },
};
</script>
<style scoped>
.login-header[data-v-37dfd6fc] {
  background: #fff;
  border-bottom: 1px solid #e4e4e4;
}
.login-header .commonwidth[data-v-37dfd6fc] {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}
.login-header .logo[data-v-37dfd6fc] {
  width: 200px;
}
.login-header .logo a[data-v-37dfd6fc] {
  display: block;
  height: 132px;
  width: 100%;
  text-indent: -9999px;
  background: url("http://erabbit.itheima.net/img/logo.0940ebb5.png") no-repeat
    center 18px / contain;
}
.login-header .sub[data-v-37dfd6fc] {
  flex: 1;
  font-size: 24px;
  font-weight: 400;
  margin-bottom: 38px;
  margin-left: 20px;
  color: #666;
}
.login-header .entry[data-v-37dfd6fc] {
  width: 120px;
  margin-bottom: 38px;
  font-size: 16px;
}
.login-header .entry i[data-v-37dfd6fc] {
  font-size: 14px;
  color: #27ba9b;
  letter-spacing: -5px;
}
.login-section[data-v-37dfd6fc] {
  background: url("http://erabbit.itheima.net/img/login-bg.696efec3.png")
    no-repeat 50% / cover;
  height: 488px;
  position: relative;
}
.login-section .wrapper[data-v-37dfd6fc] {
  width: 380px;
  background: #fff;
  min-height: 400px;
  position: absolute;
  left: 50%;
  top: 54px;
  transform: translate3d(100px, 0, 0);
  box-shadow: 0 0 10px rgb(0 0 0 / 15%);
}
.login-section .wrapper nav[data-v-37dfd6fc] {
  height: 55px;
  border-bottom: 1px solid #f5f5f5;
  display: flex;
  padding: 0 40px;
  text-align: right;
  align-items: center;
}
.login-section .wrapper nav a[data-v-37dfd6fc]:first-child {
  border-right: 1px solid #f5f5f5;
  text-align: left;
}
.login-section .wrapper nav a[data-v-37dfd6fc] {
  flex: 1;
  line-height: 1;
  display: inline-block;
  font-size: 18px;
  position: relative;
}
.account-box .toggle[data-v-37dfd6fc] {
  padding: 15px 40px;
  text-align: right;
}
.account-box .toggle a[data-v-37dfd6fc] {
  color: #27ba9b;
}
.account-box .toggle a i[data-v-37dfd6fc] {
  font-size: 14px;
}
.account-box .form[data-v-37dfd6fc] {
  padding: 0 40px;
}
.account-box .form-item[data-v-37dfd6fc] {
  margin-bottom: 28px;
}
.account-box .form-item .input[data-v-37dfd6fc] {
  position: relative;
  height: 36px;
}
.account-box .form-item .input > i[data-v-37dfd6fc] {
  width: 34px;
  height: 34px;
  background: #cfcdcd;
  color: #fff;
  position: absolute;
  left: 1px;
  top: 1px;
  text-align: center;
  line-height: 34px;
  font-size: 18px;
}
.account-box .form-item .input input[data-v-37dfd6fc] {
  padding-left: 44px;
  border: 1px solid #cfcdcd;
  height: 36px;
  line-height: 36px;
  width: 80%;
}
.account-box .form-item[data-v-37dfd6fc] {
  margin-bottom: 28px;
}
.account-box .form-item .input > i[data-v-37dfd6fc] {
  width: 34px;
  height: 34px;
  background: #cfcdcd;
  color: #fff;
  position: absolute;
  left: 1px;
  top: 1px;
  text-align: center;
  line-height: 34px;
  font-size: 18px;
}
.account-box .form .btn[data-v-37dfd6fc] {
  display: block;
  width: 100%;
  height: 40px;
  color: #fff;
  text-align: center;
  line-height: 40px;
  background: #27ba9b;
}
.account-box .action[data-v-37dfd6fc] {
  padding: 20px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.account-box .action .url a[data-v-37dfd6fc] {
  color: #999;
  margin-left: 10px;
}
.login-footer[data-v-37dfd6fc] {
  padding: 30px 0 50px;
  background: #fff;
}
.login-footer p[data-v-37dfd6fc] {
  text-align: center;
  color: #999;
  padding-top: 20px;
}
.login-footer p a[data-v-37dfd6fc] {
  line-height: 1;
  padding: 0 10px;
  color: #999;
  display: inline-block;
}
</style>